package cn.royan.fl.controllers.commands 
{
	import cn.royan.fl.utils.Logger;
	import cn.royan.fl.values.ClientConfig;
	import cn.royan.fl.proxys.ClientSocketProxy;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	/**
	 * ...
	 * @author RoYan
	 */
	public class StartSocketCommand extends SimpleCommand 
	{
		override public function execute(notification:INotification):void 
		{
			if ( !facade.hasProxy( ClientSocketProxy.NAME ) )
				facade.registerProxy( new ClientSocketProxy() );
			var socketProxy:ClientSocketProxy = facade.retrieveProxy( ClientSocketProxy.NAME ) as ClientSocketProxy;
				socketProxy.runClient( notification.getBody() as ClientConfig );
		}
	}

}